﻿<!DOCTYPE html>
<html>
<head>
    <title>CGI</title>
</head>
<body>
    <h1>Our Page</h1>
    <!--generally it's a good idea to work in Strict Mode
    it helpsto write better code and detects error that you may not find-->
    <script>
        //01
        //here we get error, as newVar is undefined
        //due to Strict Mode,it's prevent JS engine to create this as a global variable
        var actNow = function () {
            'use strict';
            newVar = 9;
        };
        actNow();

        //02
        //in Strict Mode,if we declare a variable, we can't get rid of it
        //var actNow = function () {
        //    'use strict';
        //    var newVar = 9;
        //    delete newVar;
        //};
        //actNow();

        //03
        //duplicate parameter error can caught only in Strict Mode
        //var actNow = function () {
        //    'use strict';
        //    var fn = function (a, a) {
        //    };
        //};
        //actNow();

    </script>
</body>
</html>